package service.impl;

import dao.RoleDao;
import dao.StudentDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import po.Role;
import po.Student;
import service.RoleService;
import service.StudentService;

import java.util.List;

@Service
@Transactional
public class StudentServiceImpl implements StudentService {
    // 注解注入 RoleDao
    @Autowired
    private StudentDao studentDao;

    @Override
    public List<Student> allStudent(Student student) {
        return studentDao.allStudent(student);
    }

    @Override
    public Boolean deleteStudent(Integer id) {

        return studentDao.deleteStudent(id) > 0 ;
    }

    @Override
    public Boolean addStudent(Student student) {

        return studentDao.addStudent(student) > 0 ;
    }

    @Override
    public Student studentOfId(Integer id) {

        return studentDao.studentOfId(id);
    }

    @Override
    public Boolean editStudent(Student student) {
        return studentDao.editStudent(student)>0;
    }

    @Override
    public Boolean isEnableStudent(Integer id ,Integer flag) {
        return studentDao.isEnableStudent(id,flag) > 0;
    }

}
